package com.example.q_kang.hhh.setting;


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.widget.Button;
import android.widget.EditText;

import com.example.q_kang.hhh.R;
import com.hjq.toast.ToastUtils;
import com.sskj.base.MVPActivity;
import com.sskj.base.base.App;
import com.sskj.base.utils.ClickUtil;
import com.sskj.base.view.ToolBarLayout;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * @author Hey
 * Create at  2019/04/10
 */
public class FeedBackActivity extends MVPActivity<FeedBackPresenter> {


    @BindView(R.id.toolbar)
    ToolBarLayout toolbar;
    @BindView(R.id.et_problem)
    EditText etProblem;
    @BindView(R.id.btn_submit)
    Button btnSubmit;

    @Override
    public int getLayoutId() {
        return R.layout.activity_feed_back;
    }

    @Override
    public FeedBackPresenter getPresenter() {
        return new FeedBackPresenter();
    }

    @Override
    public void initView() {
        toolbar.setLeftButtonOnClickListener(view -> finish());
        ClickUtil.click(300, btnSubmit, view -> {
            if (TextUtils.isEmpty(getEtext(etProblem))) {
                ToastUtils.show(App.INSTANCE.getString(R.string.appJavaFeedBackActivity1));
                return;
            }
            mPresenter.sendMessage(getEtext(etProblem));
        });
    }

    @Override
    public void initData() {

    }

    public static void start(Context context) {
        Intent intent = new Intent(context, FeedBackActivity.class);
        context.startActivity(intent);
    }
}
